package com.example.demo;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class MyListener implements ApplicationListener {
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        try {
            Thread.sleep(130);
            System.out.println("MyListener "+event.getClass());
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
